package cn.stylefeng.guns.core.common.util;

import cn.stylefeng.guns.core.common.cons.GeneralTypeEnum;
import cn.stylefeng.guns.modular.system.entity.Rent;

import java.util.Date;
import java.util.List;
import java.util.Map;


public class PackageObject {


    public static Rent packageRent(Long userId, Long carId,
                                   String cardName, String carType,
                                   Date rentTime,Double rentDeposit,
                                   String rentPlace, String returnPlace){
        Rent rent = new Rent();
        rent.setUserId(userId);
        rent.setCarId(carId);
        rent.setCardName(cardName);
        rent.setCarType(carType);
        rent.setRentTime(rentTime);
        rent.setRentDeposit(rentDeposit);
        rent.setRentPlace(rentPlace);
        rent.setReturnPlace(returnPlace);
        rent.setIsReturn(GeneralTypeEnum.NO_RETURN.getCode());
        return rent;
    }

    /*public static List<Map<String, Object>> checkDate(List<Map<String, Object>> activitys) {
        Date now = new Date();
        for (Map<String, Object> activity : activitys) {
            Date endTime = (Date)activity.get("endTime");
            if (DateUtil.getDifference(endTime, now) < 0){
                activitys.remove(activity);
            }
        }
        return activitys;
    }*/
}
